package com.briup.app01.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.briup.app01.bean.Category;

public interface CategoryDao {
     @Insert("insert into cms_category(id,name,description,no,parent_id)"
     		+ "values(null,#{name},#{description},#{no},#{parentId})")
	public void save(Category category);
     
     @Select("select * from cms_category")
    List<Category> selectAll();
    
     @Select("select * from cms_category where id = #{id}")
    Category selectById(Long id);
     
     @Delete("delete from cms_category where id = #{id}")
     void delete(Long id);
     
     @Update("update cms_category set name = "
     		+ "#{name},description = #{description},"
     		+ "no =#{no},parent_id=#{parentId} where id =#{id}")
     void update(Category category);
	
}
